package com.itheima.mapper1;


import com.itheima.domain.User;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

/**
 * @author wuyiqiang
 * @2022/6/17 16:57
 */
@Mapper
public interface UserMapper {


    /**
     * 查询电话是否存在
     * @param phone
     * @return
     */
    @Select("select * from user where phone=#{phone}")
    User findByPhone(String phone);

    /**
     * 新增用户
     * @param user
     */
    @Insert("insert into user (id,phone,status,token) values (#{id},#{phone},#{status},#{token}) ")
    void add(User user);

}
